/***********************************************************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
* No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
* applicable laws, including copyright laws. 
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIESREGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT.  ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
* LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
* ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability 
* of this software. By using this software, you agree to the additional terms and conditions found by accessing the 
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2016, 2017 Renesas Electronics Corporation. All rights reserved.
***********************************************************************************************************************/

/***********************************************************************************************************************
* File Name    : r_cg_port.h
* Version      : Applilet4 for R7F0C903-908 V1.00.01.02 [30 Nov 2017]
* Device(s)    : R7F0C908B
* Tool-Chain   : CCRL
* Description  : This file implements device driver for Port module.
* Creation Date: 2022/9/5
***********************************************************************************************************************/
#ifndef PORT_H
#define PORT_H

/***********************************************************************************************************************
Macro definitions (Register bit)
***********************************************************************************************************************/
/*
    Port Mode Register (PMm)
*/
/* Pmn pin I/O mode selection (PMm7 - PMm0) */
#define _01_PMm0_NOT_USE        (0x01U) /* not use Pm0 as digital I/O */
#define _01_PMm0_MODE_INPUT     (0x01U) /* use Pm0 as input mode */
#define _00_PMm0_MODE_OUTPUT    (0x00U) /* use Pm0 as output mode */
#define _02_PMm1_NOT_USE        (0x02U) /* not use Pm1 as digital I/O */
#define _02_PMm1_MODE_INPUT     (0x02U) /* use Pm1 as input mode */
#define _00_PMm1_MODE_OUTPUT    (0x00U) /* use Pm1 as output mode */
#define _04_PMm2_NOT_USE        (0x04U) /* not use Pm2 as digital I/O */
#define _04_PMm2_MODE_INPUT     (0x04U) /* use Pm2 as input mode */
#define _00_PMm2_MODE_OUTPUT    (0x00U) /* use Pm2 as output mode */
#define _08_PMm3_NOT_USE        (0x08U) /* not use Pm3 as digital I/O */
#define _08_PMm3_MODE_INPUT     (0x08U) /* use Pm3 as input mode */
#define _00_PMm3_MODE_OUTPUT    (0x00U) /* use Pm3 as output mode */
#define _10_PMm4_NOT_USE        (0x10U) /* not use Pm4 as digital I/O */
#define _10_PMm4_MODE_INPUT     (0x10U) /* use Pm4 as input mode */
#define _00_PMm4_MODE_OUTPUT    (0x00U) /* use Pm4 as output mode */
#define _20_PMm5_NOT_USE        (0x20U) /* not use Pm5 as digital I/O */
#define _20_PMm5_MODE_INPUT     (0x20U) /* use Pm5 as input mode */
#define _00_PMm5_MODE_OUTPUT    (0x00U) /* use Pm5 as output mode */
#define _40_PMm6_NOT_USE        (0x40U) /* not use Pm6 as digital I/O */
#define _40_PMm6_MODE_INPUT     (0x40U) /* use Pm6 as input mode */
#define _00_PMm6_MODE_OUTPUT    (0x00U) /* use Pm6 as output mode */
#define _80_PMm7_NOT_USE        (0x80U) /* not use Pm7 as digital I/O */
#define _80_PMm7_MODE_INPUT     (0x80U) /* use Pm7 as input mode */
#define _00_PMm7_MODE_OUTPUT    (0x00U) /* use Pm7 as output mode */

/*
    Port Register (Pm)
*/
/* Pmn pin data (Pm0 to Pm7) */
#define _00_Pm0_OUTPUT_0        (0x00U) /* Pm0 output 0 */
#define _01_Pm0_OUTPUT_1        (0x01U) /* Pm0 output 1 */
#define _00_Pm1_OUTPUT_0        (0x00U) /* Pm1 output 0 */
#define _02_Pm1_OUTPUT_1        (0x02U) /* Pm1 output 1 */
#define _00_Pm2_OUTPUT_0        (0x00U) /* Pm2 output 0 */
#define _04_Pm2_OUTPUT_1        (0x04U) /* Pm2 output 1 */
#define _00_Pm3_OUTPUT_0        (0x00U) /* Pm3 output 0 */
#define _08_Pm3_OUTPUT_1        (0x08U) /* Pm3 output 1 */
#define _00_Pm4_OUTPUT_0        (0x00U) /* Pm4 output 0 */
#define _10_Pm4_OUTPUT_1        (0x10U) /* Pm4 output 1 */
#define _00_Pm5_OUTPUT_0        (0x00U) /* Pm5 output 0 */
#define _20_Pm5_OUTPUT_1        (0x20U) /* Pm5 output 1 */
#define _00_Pm6_OUTPUT_0        (0x00U) /* Pm6 output 0 */
#define _40_Pm6_OUTPUT_1        (0x40U) /* Pm6 output 1 */
#define _00_Pm7_OUTPUT_0        (0x00U) /* Pm7 output 0 */
#define _80_Pm7_OUTPUT_1        (0x80U) /* Pm7 output 1 */

/*
    Pull-up Resistor Option Register (PUm)
*/
/* Pmn pin on-chip pull-up resistor selection (PUmn) */
#define _00_PUm0_PULLUP_OFF     (0x00U) /* Pm0 pull-up resistor not connected */
#define _01_PUm0_PULLUP_ON      (0x01U) /* Pm0 pull-up resistor connected */
#define _00_PUm1_PULLUP_OFF     (0x00U) /* Pm1 pull-up resistor not connected */
#define _02_PUm1_PULLUP_ON      (0x02U) /* Pm1 pull-up resistor connected */
#define _00_PUm2_PULLUP_OFF     (0x00U) /* Pm2 Pull-up resistor not connected */
#define _04_PUm2_PULLUP_ON      (0x04U) /* Pm2 pull-up resistor connected */
#define _00_PUm3_PULLUP_OFF     (0x00U) /* Pm3 pull-up resistor not connected */
#define _08_PUm3_PULLUP_ON      (0x08U) /* Pm3 pull-up resistor connected */
#define _00_PUm4_PULLUP_OFF     (0x00U) /* Pm4 pull-up resistor not connected */
#define _10_PUm4_PULLUP_ON      (0x10U) /* Pm4 pull-up resistor connected */
#define _00_PUm5_PULLUP_OFF     (0x00U) /* Pm5 pull-up resistor not connected */
#define _20_PUm5_PULLUP_ON      (0x20U) /* Pm5 pull-up resistor connected */
#define _00_PUm6_PULLUP_OFF     (0x00U) /* Pm6 pull-up resistor not connected */
#define _40_PUm6_PULLUP_ON      (0x40U) /* Pm6 pull-up resistor connected */
#define _00_PUm7_PULLUP_OFF     (0x00U) /* Pm7 pull-up resistor not connected */
#define _80_PUm7_PULLUP_ON      (0x80U) /* Pm7 pull-up resistor connected */

/*
    Port Input Mode Register (PIMm)
*/
/* Pmn pin input buffer selection (PIMmn) */
#define _00_PIMm0_TTL_OFF       (0x00U) /* set Pm0 normal input buffer */
#define _01_PIMm0_TTL_ON        (0x01U) /* set Pm0 TTL input buffer */
#define _00_PIMm1_TTL_OFF       (0x00U) /* set Pm1 normal input buffer */
#define _02_PIMm1_TTL_ON        (0x02U) /* set Pm1 TTL input buffer */
#define _00_PIMm3_TTL_OFF       (0x00U) /* set Pm3 normal input buffer */
#define _08_PIMm3_TTL_ON        (0x08U) /* set Pm3 TTL input buffer */
#define _00_PIMm4_TTL_OFF       (0x00U) /* set Pm4 normal input buffer */
#define _10_PIMm4_TTL_ON        (0x10U) /* set Pm4 TTL input buffer */
#define _00_PIMm5_TTL_OFF       (0x00U) /* set Pm5 normal input buffer */
#define _20_PIMm5_TTL_ON        (0x20U) /* set Pm5 TTL input buffer */
#define _00_PIMm6_TTL_OFF       (0x00U) /* set Pm6 normal input buffer */
#define _40_PIMm6_TTL_ON        (0x40U) /* set Pm6 TTL input buffer */
#define _00_PIMm7_TTL_OFF       (0x00U) /* set Pm7 normal input buffer */
#define _80_PIMm7_TTL_ON        (0x80U) /* set Pm7 TTL input buffer */

/*
    Port Output Mode Register (POMm)
*/
/* Pmn pin output mode selection (POMmn) */
#define _00_POMm0_NCH_OFF       (0x00U) /* set Pm0 output normal mode */
#define _01_POMm0_NCH_ON        (0x01U) /* set Pm0 output N-ch open-drain mode */
#define _00_POMm1_NCH_OFF       (0x00U) /* set Pm1 output normal mode */
#define _02_POMm1_NCH_ON        (0x02U) /* set Pm1 output N-ch open-drain mode */
#define _00_POMm2_NCH_OFF       (0x00U) /* set Pm2 output normal mode */
#define _04_POMm2_NCH_ON        (0x04U) /* set Pn2 output N-ch open-drain mode */
#define _00_POMm3_NCH_OFF       (0x00U) /* set Pm3 output normal mode */
#define _08_POMm3_NCH_ON        (0x08U) /* set Pm3 output N-ch open-drain mode */
#define _00_POMm4_NCH_OFF       (0x00U) /* set Pm4 output normal mode */
#define _10_POMm4_NCH_ON        (0x10U) /* set Pm4 output N-ch open-drain mode */
#define _00_POMm5_NCH_OFF       (0x00U) /* set Pm5 output normal mode */
#define _20_POMm5_NCH_ON        (0x20U) /* set Pm5 output N-ch open-drain mode */
#define _00_POMm7_NCH_OFF       (0x00U) /* set Pm7 output normal mode */
#define _80_POMm7_NCH_ON        (0x80U) /* set Pm7 output N-ch open-drain mode */

/*
    Port Operation Mode Register (PMCm)
*/
/* Pmn pin digital input buffer selection (PMCmn) */
#define _01_PMCm0_NOT_USE       (0x01U) /* Pm0 analog input */
#define _00_PMCm0_DI_ON         (0x00U) /* Pm0 digital I/O */
#define _02_PMCm1_NOT_USE       (0x02U) /* Pm1 analog input */
#define _00_PMCm1_DI_ON         (0x00U) /* Pm1 digital I/O */
#define _80_PMCm7_NOT_USE       (0x80U) /* Pm7 analog input */
#define _00_PMCm7_DI_ON         (0x00U) /* Pm7 digital I/O */

/*
    AD port configuration register (ADPC)
*/
#define _00_ADPC_DI_OFF         (0x00U) /* use P23, P22, P21, P20 as analog input */
#define _04_ADPC_DI_ON          (0x04U) /* use P23, P22, P21, P20 as digital input */
#define _03_ADPC_DI_ON          (0x03U) /* use P22, P21, P20 as digital input */
#define _02_ADPC_DI_ON          (0x02U) /* use P21, P20 as digital input */
#define _01_ADPC_DI_ON          (0x01U) /* use P20 as digital input */


/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
#define _FC_PM0_DEFAULT         (0xFCU) /* PM0 default value */
#define _F0_PM2_DEFAULT         (0xF0U) /* PM2 default value */
#define _FC_PM3_DEFAULT         (0xFCU) /* PM3 default value */
#define _FE_PM4_DEFAULT         (0xFEU) /* PM4 default value */
#define _FC_PM5_DEFAULT         (0xFCU) /* PM5 default value */
#define _F8_PM6_DEFAULT         (0xF8U) /* PM6 default value */
#define _FE_PM7_DEFAULT         (0xFEU) /* PM7 default value */
#define _FE_PM12_DEFAULT        (0xFEU) /* PM12 default value */
#define _7F_PM14_DEFAULT        (0x7FU) /* PM14 default value */
#define _FC_PMC0_DEFAULT        (0xFCU) /* PMC0 default value */
#define _FE_PMC12_DEFAULT       (0xFEU) /* PMC12 default value */
#define _7F_PMC14_DEFAULT       (0x7FU) /* PMC14 default value */

/***********************************************************************************************************************
Typedef definitions
***********************************************************************************************************************/

/***********************************************************************************************************************
Global functions
***********************************************************************************************************************/
void R_PORT_Create(void);

/* Start user code for function. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
#endif
